package com.yuehuanghun.admin.core.mapper;

import com.yuehuanghun.admin.core.domain.SysUserPost;
import com.yuehuanghun.mybatis.milu.BaseMapper;
import com.yuehuanghun.mybatis.milu.annotation.NamingQuery;

/**
 * 用户与岗位关联表 数据层
 * 
 * @author yadmin
 */
public interface SysUserPostMapper extends BaseMapper<SysUserPost, Long> {
	/**
	 * 通过用户ID删除用户和岗位关联
	 * 
	 * @param userId 用户ID
	 * @return 结果
	 */
	@NamingQuery
	public int deleteByUserId(Long userId);

	/**
	 * 通过岗位ID查询岗位使用数量
	 * 
	 * @param postId 岗位ID
	 * @return 结果
	 */
	@NamingQuery
	public int countByPostId(Long postId);

	/**
	 * 批量删除用户和岗位关联
	 * 
	 * @param ids 需要删除的数据ID
	 * @return 结果
	 */
	@NamingQuery
	public int deleteByUserIdIn(Long[] ids);
}
